PROGS = all
CFLAGS  = -Wall -g

CC:=gcc
LIBS += -L/mnt/f/mylibs/libevent/libs -l event
LIBS += -L/mnt/f/mylibs/libevent/libs -l event_core
LIBS += -L/mnt/f/mylibs/libevent/libs -l event_extra
LIBS += -L/mnt/f/mylibs/libevent/libs -l event_pthreads
INC := -I ./
INC +=-I /mnt/f/mylibs/libevent/include/

depends_c = $(wildcard  ./*.c)     #找到所有的.c文件
depends_cpp = $(wildcard  ./*.cpp) #找到所有的.cpp文件
all_objs = $(depends_c:%.c=%) $(depends_cpp:%.cpp=%) #生成目标名
o_objs = $(depends_c:%.c=%.o) $(depends_cpp:%.cpp=%.o)

# .o:
# 	$(CC) $(CFLAGS) $(CPPFLAGS) $< -o $* ${INC} $(LIBS)

all:${all_objs}
# main:${o_objs}
# 	${CC} ${CFLAGS} -o $@ $^ ${INC} ${LIBS}
01_logTest:01_logTest.c
	${CC} ${CFLAGS} -o $@ $^ ${INC} ${LIBS}
02_avoidMethod:02_avoidMethod.c
	${CC} ${CFLAGS} -o $@ $^ ${INC} ${LIBS}
03_getMethod:03_getMethod.c
	${CC} ${CFLAGS} -o $@ $^ ${INC} ${LIBS}
04_get_features:04_get_features.c
	${CC} ${CFLAGS} -o $@ $^ ${INC} ${LIBS}
05_shutDownImmediately:05_shutDownImmediately.c
	${CC} ${CFLAGS} -o $@ $^ ${INC} ${LIBS}
06_loopfor10sec:06_loopfor10sec.c
	${CC} ${CFLAGS} -o $@ $^ ${INC} ${LIBS}
07_client:07_client.c
	${CC} ${CFLAGS} -o $@ $^ ${INC} ${LIBS}
08_server:08_server.c
	${CC} ${CFLAGS} -o $@ $^ ${INC} ${LIBS}
09_event_new:09_event_new.c
	${CC} ${CFLAGS} -o $@ $^ ${INC} ${LIBS} -DUSE_DEBUG
10_event_assign:10_event_assign.c
	${CC} ${CFLAGS} -o $@ $^ ${INC} ${LIBS}
11_event_assign:11_event_assign.c
	${CC} ${CFLAGS} -o $@ $^ ${INC} ${LIBS}
12_priority:12_priority.c
	${CC} ${CFLAGS} -o $@ $^ ${INC} ${LIBS}
13_event_status:13_event_status.c
	${CC} ${CFLAGS} -o $@ $^ ${INC} ${LIBS}
14_active_event:14_active_event.c
	${CC} ${CFLAGS} -o $@ $^ ${INC} ${LIBS}
15_bufferevent_sockfd:15_bufferevent_sockfd.c
	${CC} ${CFLAGS} -o $@ $^ ${INC} ${LIBS}
16_client:16_client.c
	${CC} ${CFLAGS} -o $@ $^ ${INC} ${LIBS}
17_server:17_server.c
	${CC} ${CFLAGS} -o $@ $^ ${INC} ${LIBS}
18_client:18_client.c
	${CC} ${CFLAGS} -o $@ $^ ${INC} ${LIBS}
19_server:19_server.c
	${CC} ${CFLAGS} -o $@ $^ ${INC} ${LIBS}
20_echo_server:20_echo_server.c
	${CC} ${CFLAGS} -o $@ $^ ${INC} ${LIBS}

clean:
	rm -f $(all_objs) $(o_objs) $(PROGS) *.out
